package abc.secgroup.music_backend.entity.dto;

public class Result<T> {

    private int code;
    //默认状态为完成
    private boolean status = true;

    private T data;

    public Result(){

    }

    public Result(int code) {
        this.code = code;
    }

    public Result(int code, boolean status, T data) {
        this.code = code;
        this.status = status;
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public static Result<String>  NOT_FOUND() {
        return new Result<>(404, false, "RESOURCES_NOT_FOUND");
    }
}
